package com.analysis.mapper;

import com.analysis.entity.ProjectBrand;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface ProjectBrandMapper {
    int insert(ProjectBrand projectBrand);

    int deleteById(@Param("id") Long id);

    int update(ProjectBrand projectBrand);

    ProjectBrand selectById(@Param("id") Long id);

    List<ProjectBrand> selectByProjectId(@Param("projectId") Long projectId);

    List<ProjectBrand> selectByProjectIds(@Param("projectId") List<Long> projectIds);

    List<ProjectBrand> selectByPage(@Param("projectId") Long projectId, @Param("offset") int offset, @Param("limit") int limit);

    int countByProjectId(@Param("projectId") Long projectId);

    ProjectBrand selectByProjectIdAndFilterName(@Param("projectId") Long projectId, @Param("filterName") String filterName);

    /**
     * 根据项目ID查询当前选中的品牌
     */
    ProjectBrand selectSelectedByProjectId(@Param("projectId") Long projectId);

    /**
     * 取消项目所有品牌的选中状态
     */
    int unselectAllByProjectId(@Param("projectId") Long projectId);

    /**
     * 设置指定品牌为选中状态
     */
    int selectBrand(@Param("id") Long id);
}
